﻿using System.Linq;
using System;
using System.Collections.Generic;

namespace Caffeine.Core.Test.TestModel.Merge
{
    public class ModelC : ModelB
    {
        ModelProperty<String> _firstAndLastName;

        public ModelC()
        {
            _firstAndLastName = RegisterComputedProperty<string>
            (
                "FirstAndLastName",
                ComputeFirstAndLastName,
                LastNameProperty,
                FirstNameProperty
            );
        }

        private string ComputeFirstAndLastName(IEnumerable<ModelProperty<string>> values, string currentValue)
        {
            ModelProperty<string> lastNameProperty = values.ElementAt(0);
            ModelProperty<string> firstNameProperty = values.ElementAt(1);
            string firstNameAndLastName = null;

            if (!string.IsNullOrWhiteSpace(lastNameProperty.Value) && !string.IsNullOrWhiteSpace(firstNameProperty.Value))
            {
                firstNameAndLastName = string.Format("{0}, {1}", lastNameProperty.Value, firstNameProperty.Value);
            }

            return firstNameAndLastName;
        }

        public ModelProperty<String> FirstAndLastName
        {
            get
            {
                return _firstAndLastName;
            }
        }

        #region FirstName Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(string), "FirstNameProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<string> _FirstNameProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the FirstName backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<string> FirstNameProperty
        {
            get { return _FirstNameProperty; }
        }

        /// <summary>
        /// Gets or sets the FirstNameProperty.Value value. This property supports change notification. If the FirstNameProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstNameProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual string FirstName
        {
            get { return FirstNameProperty.Value; }
            set { FirstNameProperty.Value = value; }
        }

        #endregion

        #region LastName Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(string), "LastNameProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<string> _LastNameProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the LastName backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<string> LastNameProperty
        {
            get { return _LastNameProperty; }
        }

        /// <summary>
        /// Gets or sets the LastNameProperty.Value value. This property supports change notification. If the LastNameProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [LastNameProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual string LastName
        {
            get { return LastNameProperty.Value; }
            set { LastNameProperty.Value = value; }
        }

        #endregion

        #region IntProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(int), "IntPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<int> _IntPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the IntProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<int> IntPropertyProperty
        {
            get { return _IntPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the IntPropertyProperty.Value value. This property supports change notification. If the IntPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [IntPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual int IntProperty
        {
            get { return IntPropertyProperty.Value; }
            set { IntPropertyProperty.Value = value; }
        }

        #endregion

        #region CharProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(char), "CharPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<char> _CharPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the CharProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<char> CharPropertyProperty
        {
            get { return _CharPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the CharPropertyProperty.Value value. This property supports change notification. If the CharPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [CharPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual char CharProperty
        {
            get { return CharPropertyProperty.Value; }
            set { CharPropertyProperty.Value = value; }
        }

        #endregion

        #region DecimalProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(decimal), "DecimalPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<decimal> _DecimalPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the DecimalProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<decimal> DecimalPropertyProperty
        {
            get { return _DecimalPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the DecimalPropertyProperty.Value value. This property supports change notification. If the DecimalPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [DecimalPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual decimal DecimalProperty
        {
            get { return DecimalPropertyProperty.Value; }
            set { DecimalPropertyProperty.Value = value; }
        }

        #endregion

        #region NullableIntProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<Int32>), "NullableIntPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<Int32>> _NullableIntPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableIntProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Nullable<Int32>> NullableIntPropertyProperty
        {
            get { return _NullableIntPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableIntPropertyProperty.Value value. This property supports change notification. If the NullableIntPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableIntPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Nullable<Int32> NullableIntProperty
        {
            get { return NullableIntPropertyProperty.Value; }
            set { NullableIntPropertyProperty.Value = value; }
        }

        #endregion

        #region NullableCharProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<Char>), "NullableCharPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<Char>> _NullableCharPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableCharProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Nullable<Char>> NullableCharPropertyProperty
        {
            get { return _NullableCharPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableCharPropertyProperty.Value value. This property supports change notification. If the NullableCharPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Nullable<Char> NullableCharProperty
        {
            get { return NullableCharPropertyProperty.Value; }
            set { NullableCharPropertyProperty.Value = value; }
        }

        #endregion

        #region NullableDecimalProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<Decimal>), "NullableDecimalPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<Decimal>> _NullableDecimalPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableDecimalProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Nullable<Decimal>> NullableDecimalPropertyProperty
        {
            get { return _NullableDecimalPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableDecimalPropertyProperty.Value value. This property supports change notification. If the NullableDecimalPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableDecimalPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Nullable<Decimal> NullableDecimalProperty
        {
            get { return NullableDecimalPropertyProperty.Value; }
            set { NullableDecimalPropertyProperty.Value = value; }
        }

        #endregion

        #region ObjectProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Object), "ObjectPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Object> _ObjectPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ObjectProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Object> ObjectPropertyProperty
        {
            get { return _ObjectPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the ObjectPropertyProperty.Value value. This property supports change notification. If the ObjectPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Object ObjectProperty
        {
            get { return ObjectPropertyProperty.Value; }
            set { ObjectPropertyProperty.Value = value; }
        }

        #endregion

        #region StringProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(String), "StringPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<String> _StringPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the StringProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<String> StringPropertyProperty
        {
            get { return _StringPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the StringPropertyProperty.Value value. This property supports change notification. If the StringPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [StringPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual String StringProperty
        {
            get { return StringPropertyProperty.Value; }
            set { StringPropertyProperty.Value = value; }
        }

        #endregion

        #region GuidProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Guid), "GuidPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Guid> _GuidPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the GuidProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Guid> GuidPropertyProperty
        {
            get { return _GuidPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the GuidPropertyProperty.Value value. This property supports change notification. If the GuidPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [GuidPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Guid GuidProperty
        {
            get { return GuidPropertyProperty.Value; }
            set { GuidPropertyProperty.Value = value; }
        }

        #endregion

        #region NullableGuidProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<Guid>), "NullableGuidPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<Guid>> _NullableGuidPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableGuidProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Nullable<Guid>> NullableGuidPropertyProperty
        {
            get { return _NullableGuidPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableGuidPropertyProperty.Value value. This property supports change notification. If the NullableGuidPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableGuidPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Nullable<Guid> NullableGuidProperty
        {
            get { return NullableGuidPropertyProperty.Value; }
            set { NullableGuidPropertyProperty.Value = value; }
        }

        #endregion

        #region TestEnumProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(TestEnum), "TestEnumPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<TestEnum> _TestEnumPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the TestEnumProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<TestEnum> TestEnumPropertyProperty
        {
            get { return _TestEnumPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the TestEnumPropertyProperty.Value value. This property supports change notification. If the TestEnumPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [TestEnumPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual TestEnum TestEnumProperty
        {
            get { return TestEnumPropertyProperty.Value; }
            set { TestEnumPropertyProperty.Value = value; }
        }

        #endregion

        #region NullableTestEnumProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<TestEnum>), "NullableTestEnumPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<TestEnum>> _NullableTestEnumPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableTestEnumProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<Nullable<TestEnum>> NullableTestEnumPropertyProperty
        {
            get { return _NullableTestEnumPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableTestEnumPropertyProperty.Value value. This property supports change notification. If the NullableTestEnumPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestEnumPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Nullable<TestEnum> NullableTestEnumProperty
        {
            get { return NullableTestEnumPropertyProperty.Value; }
            set { NullableTestEnumPropertyProperty.Value = value; }
        }

        #endregion

        #region ModelCProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelC), "ModelCPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<ModelC> _ModelCPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ModelCProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<ModelC> ModelCPropertyProperty
        {
            get { return _ModelCPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the ModelCPropertyProperty.Value value. This property supports change notification. If the ModelCPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [ModelCPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual ModelC ModelCProperty
        {
            get { return ModelCPropertyProperty.Value; }
            set { ModelCPropertyProperty.Value = value; }
        }

        #endregion

        #region ModelDProperty Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelD), "ModelDPropertyProperty", ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<ModelD> _ModelDPropertyProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ModelDProperty backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual Caffeine.Core.ModelProperty<ModelD> ModelDPropertyProperty
        {
            get { return _ModelDPropertyProperty; }
        }

        /// <summary>
        /// Gets or sets the ModelDPropertyProperty.Value value. This property supports change notification. If the ModelDPropertyProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [ModelDPropertyProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public virtual ModelD ModelDProperty
        {
            get { return ModelDPropertyProperty.Value; }
            set { ModelDPropertyProperty.Value = value; }
        }

        #endregion

        #region ModelCCollection Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelC), "ModelCCollection", ModelBase.StandardBehaviors, true, true)]
        protected readonly Caffeine.Core.ModelCollection<ModelC> _ModelCCollection = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ModelCCollection property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public virtual Caffeine.Core.ModelCollection<ModelC> ModelCCollection
        {
            get { return _ModelCCollection; }
        }

        #endregion

        #region ModelDCollection Property (INPC Only)

        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelD), "ModelDCollection", ModelBase.StandardBehaviors, true, true)]
        protected readonly Caffeine.Core.ModelCollection<ModelD> _ModelDCollection = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ModelDCollection property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public virtual Caffeine.Core.ModelCollection<ModelD> ModelDCollection
        {
            get { return _ModelDCollection; }
        }

        #endregion
    }
}
